<div class="layui-form-item">
    <label class="layui-form-label"><?php echo $field['title']; ?></label>
    <div class="layui-input-block">

        <!--选择基本信息分类后自动获取对应属性-->
        <div id="cateAttr">
            {volist name="cateAllAttr" id="vo"}
            <input lay-filter="checkAttr" class="checkAttr" {if in_array($vo.id,$checkAttrId)}checked{/if} type="checkbox" id="{$vo.id}" val="{$vo.attrvalue}" lay-skin="primary" title="{$vo.attrname}">
                   {/volist}
                   <input type="hidden" class="attrid" name="attr_id" value="{$attr_id}"></div>
        <!--属性列表-->
        <div id="AttrList">
            {volist name="cateattr" id="vo" key="k"}
            <dl>
                <dt>{$vo.attrname}</dt>
                <dd>
                    {volist name="$vo.attr_value" id="child" }
                    <input lay-filter="checkAttrval" {if in_array($child,$checkValue['attr_'.($k-1)])}checked{/if} class="checkAttrval"  type="checkbox" lay-skin="primary" id="{$vo.id}" ptitle="{$vo.attrname}" title="{$child}">
                           {/volist}
                </dd>
            </dl>
            {/volist}
        </div>
        <!--属性表格-->

        <div id="creatTable">
            <table class="layui-table">
                {if $productattr}
                <thead>  
                    <tr>
                        <?php
                        if (isset($cateattr[0]['attrname'])) {
                            echo '<th>' . $cateattr[0]['attrname'] . '</th>';
                        }
                        if (isset($cateattr[1]['attrname'])) {
                            echo '<th>' . $cateattr[1]['attrname'] . '</th>';
                        }
                        ?>
                        <th>价格</th>
                        <th>库存</th>
                        <th>编号</th>
                        <th>备注</th>
                    </tr>
                </thead>
                {/if}
                {volist name="$productattr" id="vo"}
                <tr>
                    <?php if (isset($cateattr[0]['attrname'])) { ?>
                        <td><input type="text" name="attr_0[]" value="{$vo.attr_0}" readonly="" class="layui-input"></td>   
                    <?php } ?>
                    <?php if (isset($cateattr[1]['attrname'])) { ?>
                        <td><input type="text" name="attr_1[]" value="{$vo.attr_1}" readonly="" class="layui-input"></td>
                    <?php } ?>
                    <td><input type="text" name="attr_price[]"  value="{$vo.attr_price}" placeholder="请输入价格" class="layui-input"></td>
                    <td><input type="text" name="attr_stock[]"  value="{$vo.attr_stock}" placeholder="请输入库存" class="layui-input"></td>
                    <td><input type="text" name="attr_number[]" value="{$vo.attr_number}" placeholder="请输入商品编号" class="layui-input"></td>
                    <td><input type="text" name="attr_remark[]" value="{$vo.attr_remark}"  placeholder="请输入备注信息" class="layui-input"></td>
                </tr>
                {/volist}
            </table>
        </div>


    </div>
</div>